<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>申报材料管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/liuxue/student/material">申报材料</a></li>
		<li class="active"><a href="${ctx}/liuxue/student/materialForm?id=${sysAttachfile.id}">申报材料<shiro:hasPermission name="sys:sysAttachfile:edit">${not empty sysAttachfile.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="sys:sysAttachfile:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="sysAttachfile" action="${ctx}/liuxue/student/materialSave" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
<%-- 		<div class="control-group">
			<label class="control-label">上传用户：</label>
			<div class="controls">
				<sys:treeselect id="user" name="user.id" value="${sysAttachfile.user.id}" labelName="user.name" labelValue="${sysAttachfile.user.name}"
					title="用户" url="/sys/office/treeData?type=3" cssClass="" allowClear="true" notAllowSelectParent="true"/>
			</div>
		</div> --%>
		<div class="control-group">
			<label class="control-label">文件名：</label>
			<div class="controls">
				<form:input path="filename" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">资料类型：</label>
			<div class="controls">
				<form:radiobuttons path="attachtype" items="${fns:getDictList('material_type')}" itemLabel="label" itemValue="value" htmlEscape="false" class=""/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">文件标签：</label>
			<div class="controls">
				<form:checkbox path="file_label"  value="A型" htmlEscape="false" class="input-xlarge required"/>A型
				<form:checkbox path="file_label"  value="B型" htmlEscape="false" class="input-xlarge required"/>B型
				<form:checkbox path="file_label"  value="C型" htmlEscape="false" class="input-xlarge required"/>C型
				<form:checkbox path="file_label"  value="D型" htmlEscape="false" class="input-xlarge required"/>D型
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">文件路径：</label>
			<div class="controls">
				<form:hidden id="filepath" path="filepath" htmlEscape="false" maxlength="200" class="input-xlarge"/>
				<sys:ckfinder input="filepath" type="files" uploadPath="/liuxue/material/${user.loginName}" selectMultiple="false"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
<%-- 		<div class="control-group">
			<label class="control-label">文件大小：</label>
			<div class="controls">
				<form:input path="filesize" htmlEscape="false" maxlength="11"  readonly="true" class="input-xlarge "/>
			</div>
		</div> --%>
		<div class="control-group">
			<label class="control-label">说明：</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="input-xxlarge required"/>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="liuxue:student:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>